package com.video.quartz;

import com.video.dao.TagsMapper;
import lombok.extern.slf4j.Slf4j;
import org.springframework.scheduling.annotation.Scheduled;
import org.springframework.stereotype.Component;

import javax.annotation.Resource;
import java.util.Date;

/**
 * @author baoshuai
 * @date 2022/12/16
 */
@Slf4j
@Component
public class InitTagsTodayCounts {

    @Resource
    private TagsMapper tagsMapper;

    @Scheduled(cron = "0 0 0 * * ?")
    public void updateBlogRunningInfo() {
        log.info("执行定时任务，初始化每日浏览量-----------------------" + new Date());
        tagsMapper.initTodayCounts();
    }
}